<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<base href="../../" />
		<script src="list.js"></script>
		<script src="page.js"></script>
		<link type="text/css" rel="stylesheet" href="page.css" />
	</head>
	<body>
		<h1>[name]</h1>

		<div class="desc">
			An AnimationClip is a reusable set of keyframe tracks which represent an animation.<br /><br />

			For an overview of the different elements of the three.js animation system see the
			"Animation System" article in the "Next Steps" section of the manual.
		</div>


		<h2>Constructor</h2>


		<h3>[name]( [page:String name], [page:Number duration], [page:Array tracks] )</h3>
		<div>
			[page:String name] - a name for this clip.<br />
			[page:Number duration] - the duration of this clip (in seconds). If a negative value is passed,
			the duration will be calculated from the passed *tracks* array.<br />
			[page:Array tracks] - an array of [page:KeyframeTrack KeyframeTracks].<br /><br />

			Note: Instead of instantiating an AnimationClip directly with the constructor, you can use one
			of its static methods to create AnimationClips: from JSON ([page:.parse parse]), from morph
			target sequences ([page:.CreateFromMorphTargetSequence CreateFromMorphTargetSequence],
			[page:.CreateClipsFromMorphTargetSequences CreateClipsFromMorphTargetSequences]) or from
			animation hierarchies ([page:.parseAnimation parseAnimation]) - if your model doesn't already
			hold AnimationClips in its geometry's animations array.
		</div>


		<h2>Properties</h2>


		<h3>[property:Number duration]</h3>
		<div>
			The duration of this clip (in seconds). This can be calculated from the [page:.tracks tracks]
			array via [page:.resetDuration resetDuration].
		</div>

		<h3>[property:String name]</h3>
		<div>
			A name for this clip. A certain clip can be searched via [page:.findByName findByName].
		</div>

		<h3>[property:Array tracks]</h3>
		<div>
			An array containing a [page:KeyframeTrack] for each property that are animated by this clip.
		</div>

		<h3>[property:String uuid]</h3>
		<div>
			The [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this clip instance.
			It gets automatically assigned and shouldn't be edited.
		</div>


		<h2>Methods</h2>


		<h3>[method:AnimationClip optimize]()</h3>
		<div>
			Optimizes each track by removing equivalent sequential keys (which are common in morph target
			sequences).
		</div>

		<h3>[method:null resetDuration]()</h3>
		<div>
			Sets the [page:.duration duration] of the clip to the duration of its longest
			[page:KeyframeTrack].
		</div>

		<h3>[method:AnimationClip trim]()</h3>
		<div>
			Trims all tracks to the clip's duration.
		</div>


		<h2>Static Methods</h2>


		<h3>[method:Array CreateClipsFromMorphTargetSequences]( [page:String name], [page:Array morphTargetSequence], [page:Number fps], [page:Boolean noLoop] )</h3>
		<div>
			Returns an array of new AnimationClips created from the [page:Geometry.morphTargets morph
			target sequences] of a geometry, trying to sort morph target names into animation-group-based
			patterns like "Walk_001, Walk_002, Run_001, Run_002 ..."<br /><br />

			This method is called by the [page:JSONLoader] internally, and it uses
			[page:.CreateFromMorphTargetSequence CreateFromMorphTargetSequence].
		</div>

		<h3>[method:AnimationClip CreateFromMorphTargetSequence]( [page:String name], [page:Array morphTargetSequence], [page:Number fps], [page:Boolean noLoop] )</h3>
		<div>
			Returns a new AnimationClip from the passed [page:Geometry.morphTargets morph targets array]
			of a geometry, taking a name and the number of frames per second.<br /><br />

			Note: The fps parameter is required, but the animation speed can be overridden in an 
			*AnimationAction* via [page:AnimationAction.setDuration animationAction.setDuration].
		</div>

		<h3>[method:AnimationClip findByName]( [page:Object objectOrClipArray], [page:String name] )</h3>
		<div>
			Searches for an AnimationClip by name, taking as its first parameter either an array of
			AnimationClips, or a mesh or geometry that contains an array named "animations".
		</div>

		<h3>[method:AnimationClip parse]( [page:Object json] )</h3>
		<div>
			Parses a JSON representation of a clip and returns an AnimationClip.
		</div>

		<h3>[method:AnimationClip parseAnimation]( [page:Object animation], [page:Array bones] )</h3>
		<div>
			Parses the animation.hierarchy format and returns an AnimationClip.
		</div>

		<h3>[method:Object toJSON]( [page:AnimationClip clip] )</h3>
		<div>
			Takes an AnimationClip and returns a JSON object.
		</div>


		<h2>Source</h2>


		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
	</body>
</html>
